package com.example.flowable.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.flowable.mapper.RoleMapper;
import com.example.flowable.model.Role;
import com.example.flowable.service.RoleService;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;
    @Override
    public void addRole(Role role) {
        roleMapper.insert(role);
    }

    @Override
    public List<Role> queryRoleList(Role role) {
        return roleMapper.selectList(new QueryWrapper<>());
    }

    @Override
    public void deleteRole(Role role) {
        roleMapper.delete(new QueryWrapper<Role>().eq("id", role.getId()));
    }
}
